/**
* 显示层级管理类
*/
class LayerManager extends eui.UILayer {

    private static _i: LayerManager;

    static get i(): LayerManager {
        return this._i || (this._i = new LayerManager());
    }

    // 场景层
    sceneLayer: eui.UILayer = new eui.UILayer();
    // 麻将层
    mainLayer: eui.UILayer = new eui.UILayer();
    // 特效层
    effectLayer: eui.UILayer = new eui.UILayer();
    // 面板层
    panelLayer: eui.UILayer = new eui.UILayer();
    // 遮罩层
    maskLayer: eui.UILayer = new eui.UILayer();
    // 加载层
    loadLayer: eui.UILayer = new eui.UILayer();
    // 顶级层(tips,horn等等)
    topLayer: eui.UILayer = new eui.UILayer();

    //构造方法
    constructor() {
        super();
        this.init();
    }

    //初始化场景类
    init(): void {
        this.touchThrough = true;
        this.sceneLayer.touchThrough = true;
        this.mainLayer.touchThrough = true;
        this.maskLayer.touchThrough = true;
        this.panelLayer.touchThrough = true;
        this.effectLayer.touchThrough = true;
        this.loadLayer.touchThrough = true;
        this.topLayer.touchThrough = true;

        this.sceneLayer.name = "sceneLayer";
        this.mainLayer.name = "mainLayer";
        this.effectLayer.name = "effectLayer";
        this.panelLayer.name = "panelLayer";
        this.maskLayer.name = "maskLayer";
        this.loadLayer.name = "loadLayer";
        this.topLayer.name = "topLayer";

        acelab.addChild(this.sceneLayer);
        acelab.addChild(this.mainLayer);
        acelab.addChild(this.maskLayer);
        acelab.addChild(this.effectLayer);
        acelab.addChild(this.panelLayer);
        acelab.addChild(this.loadLayer);
        acelab.addChild(this.topLayer);

        this.effectLayer.touchChildren = false;
        this.effectLayer.touchEnabled = false;
        this.topLayer.touchChildren = false;
        this.topLayer.touchEnabled = false;
    }
}